package com.controller;

import com.configs.Result;
import com.component.KafkaProducer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/kafka")
public class KafkaController {

    @Autowired
    private KafkaProducer kafkaProducer;

    @PostMapping("/send")
    public Result sendMessage(@RequestBody String msg) {
        kafkaProducer.send(msg);
        return Result.success("Send Kafka success");
    }

}
